{template header}

<div class="container">

<ol class="breadcrumb">
  <li><a href="{SITE_URL}">首页</a></li>
  <li class="active">文档</li>
</ol>

<div class="row">



<div class="col-md-8">

  <div class="panel panel-default">
    <div class="panel-body">
<div class="article_list">
<ul>
{loop $arrArticle $key $item}
<li>

  <!--
{if $item['photo']}
<a href="{tsUrl('article','show',array('id'=>$item[articleid]))}">
<img style="float:left;" src="{php echo tsXimg($item['photo'],'article',180,140,$item['path'],'1')}" />
</a>
{/if}
-->
  <div class="userimg"><a href="{tsUrl('user','duty',array('id'=>$item[user][userid],'groupid'=>$item[groupid]))}"><img class="img-rounded" src="{$item[user][face]}" width="32" height="32" alt="{$item['user']['username']}" title="{$item['user']['username']}" /></a></div>
<div class="article_title" style="font-size: 14px"><a href="{tsUrl('article','show',array('id'=>$item[articleid]))}" style="color: #444444">{$item[title]}</a></div>

<div class="article_info"><span style="float: left"><a href="{tsUrl('user','duty',array('id'=>$item[user][userid],'groupid'=>$item[groupid]))}">{$item[user][username]}</a>  {php echo getTime($item[addtime],time())}</span><span style="float: right">{if $item['group']}<a href="{tsUrl('article','group',array('groupid'=>$item['group']['groupid']))}">{$item['group']['groupname']}</a>{else}<a href="{tsUrl('article','group',array('groupid'=>0))}">广播</a>{/if}&nbsp;{$item['count_view']}阅 |   {$item['count_comment']}评</span></div>

  <div class="article_content" style="padding-top: 10px" onclick="jump('{php echo(tsUrl('article','show',array('id'=>$item[articleid])))}')">{$item['abs']}</div>
  <div style="{if isMobile()}display:flex;justify-content:space-between;{else}float:right;{/if}padding-top: 5px">
    {if $TS_USER[isadmin]==1||$item['userid']==$TS_USER['userid']}

    <a class="btn btn-w" style="width: 65px"  href="{SITE_URL}index.php?app=article&ac=edit&articleid={$item[articleid]}">修改</a>
    <a class="btn btn-w" style="width: 65px"  href="{SITE_URL}index.php?app=article&ac=delete&articleid={$item[articleid]}&token={$_SESSION['token']}"  onClick="return confirm('确定删除吗?')">删除</a>

    {/if}

  </div>

  <div class="clear"></div>
</li>
{/loop}
</ul>
</div>

<div class="page">{$pageUrl}</div>
</div>
</div>


</div>



<div class="col-md-4">

<a class="btn btn-info btn-block btn-lg" href="{tsUrl('article','add')}">
<span class="glyphicon glyphicon-plus-sign"></span> 写文档</a>
<p></p>


  <div class="panel panel-default">
    <div class="panel-heading">分组</div>
    <div class="panel-body">

      <select onchange="jumpto(this.options[this.options.selectedIndex].value)" name="groupid" id="groupid" class="form-control">
        <option value="">选择分组</option>
        {loop $arrGroup $key $item}
        <option value="{$item['groupid']}" {if $item['groupid']==$groupid}selected{/if}>{$item['groupname']}</option>
        {/loop}
      </select>
      <!--
{loop $arrGroup $key $item}
  <a class="btn btn-link" href="{tsUrl('article','group',array('id'=>$item['groupid']))}">{$item['groupname']}</a>
{/loop}
-->




</div>

</div>

<!--
  <div class="panel panel-default">
    <div class="panel-heading">推荐阅读</div>
    <div class="panel-body">
<div class="commlist">
<ul>
{loop $arrRecommend $key $item}
<li><a href="{tsUrl('article','show',array('id'=>$item['articleid']))}{$mylink}">{$item['title']}</a></li>
{/loop}
</ul>
</div>
</div>
</div>

  <div class="panel panel-default">
    <div class="panel-heading">一周热门</div>
    <div class="panel-body">
<div class="commlist">
<ul>
{loop $arrHot7 $key $item}
<li><a href="{tsUrl('article','show',array('id'=>$item['articleid']))}{$mylink}">{$item['title']}</a></li>
{/loop}
</ul>
</div>
</div>
</div>

  <div class="panel panel-default">
    <div class="panel-heading">一月热门</div>
    <div class="panel-body">
<div class="commlist">
<ul>
{loop $arrHot30 $key $item}
<li><a href="{tsUrl('article','show',array('id'=>$item['articleid']))}{$mylink}">{$item['title']}</a></li>
{/loop}
</ul>
</div>
</div>
</div>

-->
<!--广告位-->
{php doAction('gobad','300')}


</div>





</div>
</div>

<script>
  function jumpto(groupid){
    var url = '{SITE_URL}index.php?app=article&ac=group&groupid='+groupid;
    window.location.href=url;
  }
</script>

{template footer}